package cn.qdhlm.frontendprocessor.common.util;

import com.alibaba.fastjson.JSONObject;

/**
 * @Name: JsonUtil
 * @Description: JsonUtil
 * @Author: jiangcs
 **/
public class JsonUtil {
    /**
     * Object 2 JsonStr
     *
     * @param object
     * @return
     */
    public static String safeJsonStr(Object object) {
        if (ComUtil.isEmpty(object)) {
            return "";
        }
        return JSONObject.toJSONString(object);
    }

    public static byte[] safeJsonBytes(Object object){
        return JSONObject.toJSONBytes(object);
    }
}
